From: Florian Müllner Date: Wed, 25 Mar 2020 22:49:58 +0000 (+0100) Subject: messageTray: Only destroy policy after emitting ::destroy X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~751^2^2~48 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=279072795f9910ba335e5c3329be55d15ee9fa58;p=gnome-shell.git messageTray: Only destroy policy after emitting ::destroy Destroying the policy invalidates it, so accessing it from a Source::destroy handler (for example to disconnect signal handlers) currently results in warnings like: Object .Gjs_ui_messageTray_NotificationApplicationPolicy (0x7f8c7c0a64a0), has been already deallocated — impossible to access it. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2238 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 6f03968e9..f949345be 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -880,8 +880,6 @@ var Source = GObject.registerClass({ } destroy(reason) { - this.policy.destroy(); - let notifications = this.notifications; this.notifications = []; @@ -890,6 +888,7 @@ var Source = GObject.registerClass({ this.emit('destroy', reason); + this.policy.destroy(); this.run_dispose(); }